﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Linq;
using System.Text;
using ZOVNP.Model.Abstracts;

namespace ZOVNP.Engine
{
    internal class EngineGetter : IEngineGetter
    {
        #region Поля

        private ZOVNPEngine _engine;

        #endregion

        #region Конструкторы

        internal EngineGetter(ZOVNPEngine Engine)
        {
            _engine = Engine;
        }

        #endregion

        #region Методы

        public int GetNewOrderNumber()
        {
            int result = (int)this._engine.ExecuteScalar("select dbo.fn_GetNewOrderNumber()", CommandType.Text);
            return result;
        }

        public DataTable GetProductMaterialPriceItemsCombinations()
        {
            return _engine.ExecuteTable("select * from dbo.v_ProductMaterialPriceItemsCombinations", CommandType.Text);
        }

        #endregion

    }
}
